var shell = require('shelljs');
if (shell.exec('npm run build').code !== 0) { //执行npm run build 命令
  shell.echo('打包失败，请检查后重试');
  shell.exit(1);
}
shell.echo('正在提交git请稍后......');
shell.exec('git pull');
shell.exec('git add .');
shell.exec("git commit -m 'auto_commit'")
shell.exec('git push')
shell.echo('正在上传npm服务器请稍后......');


// shell.echo('npm version prepatch') //package.json 中的版本号1.0.1-1变为 1.0.2-0
// shell.echo('npm version preminor') //package.json 中的版本号1.0.2-0变为 1.1.0-0
// shell.echo('npm version patch') //package.json 中的版本号2.0.0-0变为 2.0.0;
// setTimeout(() => {
//   shell.exec('npm run publish')
// }, 2000)
